package com.it.LoginSystem.mapper;


import com.it.LoginSystem.Pojo.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmpMapper {
    /**
     * 根据用户名和密码查询员工(使用注解方式查询）
     * @param emp
     * @return
     */
    @Select("select * from user where username = #{username} and password = #{password}")
    Emp getByusernameAndPassword(Emp emp);

    /**
     * 根据用户名查询用户
     * @param username
     * @return
     */
    @Select("select * from user where username =#{username}")
    Emp selectByUsername(String username);

    @Select("insert into user( username, password)" + "values(#{username},#{password})")
    void insert(Emp emp);
}
